package com.car.controller;

import com.car.entity.Exchangetable;
import com.car.entity.User;
import com.car.service.ExchangetableService;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/exchange")
public class ExchangetableController   {
	
	@Autowired
	ExchangetableService exchangetableService;
	
	@RequestMapping("/toexchanView")
	public String toExchange(HttpSession session,Model model){
		User user = (User)session.getAttribute("loginSuccess");
		List<Exchangetable> list = exchangetableService.selectByuserId(user.getUserId());
		if(list.isEmpty()){
			model.addAttribute("exlist", null);
		}else{
			model.addAttribute("exlist", list);
		}
		
		return "H5phone/forRecord";
	}


}